/*
 * 
 * v1.2 by tonydon
 */
package cn.txdnet.txcms.domain;

import cn.txdnet.txweb.annotation.validation.*;
import java.math.BigDecimal;
import java.sql.Date;
import java.sql.Timestamp;
import java.util.List;

/**
 *
 * @author txdnet
 */
public class Demo extends BaseEntity{
    private static final long serialVersionUID = -2636092283395432551L;

    @Range(min=1000,max=Long.MAX_VALUE)
    private long id;
    
    @NotEmpty
    @Match(Match.RegexType.TEL)
    private String tel;
    
    @Range(min=16, max=90)
    private Byte age;
    
    @Range(min=0.01,max=10000.00)
    private double price;
    
    @ClearXss
    private String desc;
    
    @Default(longVal=101)
    private Long mount;
    
    private Long[] codes;
    
    private List<Integer> idList;
    
    private Date date;
    
    private BigDecimal decimal;
    
    private Timestamp datetime;

    /**
     * @return the id
     */
    public long getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(long id) {
        this.id = id;
    }

    /**
     * @return the tel
     */
    public String getTel() {
        return tel;
    }

    /**
     * @param tel the tel to set
     */
    public void setTel(String tel) {
        this.tel = tel;
    }

    /**
     * @return the age
     */
    public byte getAge() {
        return age;
    }

    /**
     * @param age the age to set
     */
    public void setAge(byte age) {
        this.age = age;
    }

    /**
     * @return the price
     */
    public double getPrice() {
        return price;
    }

    /**
     * @param price the price to set
     */
    public void setPrice(double price) {
        this.price = price;
    }

    /**
     * @return the desc
     */
    public String getDesc() {
        return desc;
    }

    /**
     * @param desc the desc to set
     */
    public void setDesc(String desc) {
        this.desc = desc;
    }
    
    @Override
    public String toString() {
        return "Demo{" + "id=" + id + ", tel=" + tel + ", age=" + age + ", price=" + price + ", desc=" + desc + '}';
    }

    /**
     * @return the mount
     */
    public Long getMount() {
        return mount;
    }

    /**
     * @param mount the mount to set
     */
    public void setMount(Long mount) {
        this.mount = mount;
    }

    /**
     * @return the codes
     */
    public Long[] getCodes() {
        return codes;
    }

    /**
     * @param codes the codes to set
     */
    public void setCodes(Long[] codes) {
        this.codes = codes;
    }

    /**
     * @return the idList
     */
    public List<Integer> getIdList() {
        return idList;
    }

    /**
     * @param idList the idList to set
     */
    public void setIdList(List<Integer> idList) {
        this.idList = idList;
    }

    /**
     * @return the date
     */
    public Date getDate() {
        return date;
    }

    /**
     * @param date the date to set
     */
    public void setDate(Date date) {
        this.date = date;
    }

    /**
     * @return the decimal
     */
    public BigDecimal getDecimal() {
        return decimal;
    }

    /**
     * @param decimal the decimal to set
     */
    public void setDecimal(BigDecimal decimal) {
        this.decimal = decimal;
    }

    /**
     * @return the datetime
     */
    public Timestamp getDatetime() {
        return datetime;
    }

    /**
     * @param datetime the datetime to set
     */
    public void setDatetime(Timestamp datetime) {
        this.datetime = datetime;
    }

   @Override
    public boolean validate() {
       return Validator.validate(this);
    }
}
